<?php
$catName = FrontendShopCategoryModel::model()->findByPk($data['category_id'])->title;
$this->pageTitle=Yii::app()->name . ' - '.$data['title'];
$this->breadcrumbs=array(
		$catName=>Yii::app()->controller->createUrlProductCat($data['category_id']),
		$data['title']
);?>

<div class="detail-product">
<div class="product-info">
	
	<div class="title"><h3><?php echo $data['title'];?></h3></div>
	<p class="sku"><label>Mã sản phẩm:</label>&nbsp;<strong><?php echo $data['sku'];?></strong></p>
	<p class="price"><label>Giá bán:</label>&nbsp;<span><?php echo ShopHelpers::priceFormat($data['price']);?></span></p>
	<p class="bg-title"><strong style="font-size: 15px;margin: 10px 0;">Thông tin sản phẩm</strong></p>
	<div><?php echo $data['description'];?></div>
		<?php if(Yii::app()->user->hasFlash('yiishop')):?>
		<div class="shopflash">
			<?php echo Yii::app()->user->getFlash('yiishop');?>
		</div>
		<?php endif;?>
	<div class="product-options"> 
	<?php $this->renderPartial('addToCart', array(
			'model' => $data)); ?>
	</div>
	<div class="social-like">
		<?php $this->widget('application.widgets.SocialLikeBox.SocialLikeBox');?>
	</div>
</div>
<div class="image-product">
	<div class="product-image">
	<a  href='<?php echo Yii::app()->params['shop_url'].'/full/'.$data['image'];?>'>
	<img id="pri-image" src="<?php echo Yii::app()->params['shop_url'].'/l/'.$data['image'];?>" /></a>
	</div>
	<div class="more-image">
		<a onclick="$('#pri-image').attr('src',($('#img1').attr('rel')));return false;" href='<?php echo Yii::app()->params['shop_url'].'/full/'.$data['image'];?>' >
			<img id="img1" width="50" src="<?php echo Yii::app()->params['shop_url'].'/s/'.$data['image'];?>" rel="<?php echo Yii::app()->params['shop_url'].'/l/'.$data['image'];?>"/></a>
		<?php for($i=2; $i<5; $i++):
		$field = 'image'.$i;
		if($data["$field"]!=''):
		?>
			<a onclick="$('#pri-image').attr('src',$('#img<?php echo $i?>').attr('rel'));return false;" href='<?php echo Yii::app()->params['shop_url'].'/full/'.$data["$field"];?>'>
			<img id="img<?php echo $i?>" width="50" src="<?php echo Yii::app()->params['shop_url'].'/s/'.$data["$field"];?>" rel="<?php echo Yii::app()->params['shop_url'].'/l/'.$data["$field"];?>" /></a>
		<?php
		endif;
		endfor;?>
	</div>
</div>
<div class="more-detail">
<script>
  $(function() {
    $( "#tabs" ).tabs();
  });
  </script>
  <div id="tabs">
  <ul>
    <li><a href="#tabs-1">Chi tiết sản phẩm</a></li>
    <li><a href="#tabs-2">Hướng dẫn mua hàng</a></li>
    <li><a href="#tabs-3">Hướng dẫn thanh toán</a></li>
  </ul>
  <div id="tabs-1">
    <?php echo $data['description_full'];?>
  </div>
  <div id="tabs-2">
  	<?php echo FrontendNewsModel::model()->findByPk(76)->fulltext;?>
  </div>
  <div id="tabs-3">
  	<?php echo FrontendNewsModel::model()->findByPk(75)->fulltext;?>
  </div>
</div>
</div>
</div>